/**
 * 用户中心用户首页
 * @author Ice <iceinto@mallog.com.cn>
 */
(function ($) {
    $.fn.attdis = function (options) {
        var settings = {nav:"div.regtit>a"};
        if (options) {
            $.extend(settings, options);
        }
        var getHtml = function (url) {
            $("#dis").html("Loading...");
            $url = m.app + url;
            $.get($url, function (result) {
                if (result.status) {
                    $("#dis").html(result.data);
                } else {

                }
            }, "json");
        }
        $(settings.nav).click(function () {
            var self = this;
            // Remove on
            $(settings.nav).removeClass('on');
            // This add on class
            $(self).addClass('on');
            // Get html
            getHtml($(self).data('nav'));
        });
        getHtml($(settings.nav + ":first").addClass('on').data('nav'));
    }
})(jQuery);